import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 导入 Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 引入中文语言包
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// 导入 i18n 配置
import i18n from './locales/i18n'

import Vant from 'vant';
import 'vant/lib/index.css';

const app = createApp(App)

// 注册所有图标为全局组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 使用 Element Plus 并设置语言为中文
app.use(ElementPlus, {
  locale: zhCn,
})

app.use(i18n)
app.use(Vant);
app.use(store).use(router).mount('#app')
